package domain.entities;

import javax.persistence.*;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Protocolscorecard entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "protocolscorecard", catalog = "bms")
public class Protocolscorecard implements java.io.Serializable {

	// Fields

	private Integer id;
	private Scorecard scorecard;
	private Date actualDate;
	private String comments;
	private Date correctedDate;
	private String description;
	private String metrics;
	private Date plannedDate;
	private String responsible;
    private Integer duration;
    private String predecessor;
    private String milestone;
    private Integer scorecardOrder;

    private ScorecardConfiguration scorecardConfigurationid;
    private Integer scid;


	// Constructors

	/** default constructor */
	public Protocolscorecard() {
	}

	/** minimal constructor */
	public Protocolscorecard(Scorecard scorecard) {
		this.scorecard = scorecard;
	}

	/** full constructor */
	public Protocolscorecard(Scorecard scorecard,
			Date actualDate, String comments, Date correctedDate,
			String description, String metrics, Date plannedDate,
			String responsible) {
		this.scorecard = scorecard;
		this.actualDate = actualDate;
		this.comments = comments;
		this.correctedDate = correctedDate;
		this.description = description;
		this.metrics = metrics;
		this.plannedDate = plannedDate;
		this.responsible = responsible;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "SCORECARDid", nullable = false)
	public Scorecard getScorecard() {
		return this.scorecard;
	}

	public void setScorecard(Scorecard scorecard) {
		this.scorecard = scorecard;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "actualDate", length = 10)
	public Date getActualDate() {
		return this.actualDate;
	}

	public void setActualDate(Date actualDate) {
		this.actualDate = actualDate;
	}

	@Column(name = "comments")
	public String getComments() {
		return this.comments;
	}

	public void setComments(String comments) {
		this.comments = comments;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "correctedDate", length = 10)
	public Date getCorrectedDate() {
		return this.correctedDate;
	}

	public void setCorrectedDate(Date correctedDate) {
		this.correctedDate = correctedDate;
	}

	@Column(name = "description")
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "metrics")
	public String getMetrics() {
		return this.metrics;
	}

	public void setMetrics(String metrics) {
		this.metrics = metrics;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "plannedDate", length = 10)
	public Date getPlannedDate() {
		return this.plannedDate;
	}

	public void setPlannedDate(Date plannedDate) {
		this.plannedDate = plannedDate;
	}

	@Column(name = "responsible")
	public String getResponsible() {
		return this.responsible;
	}

	public void setResponsible(String responsible) {
		this.responsible = responsible;
	}

    @Column(name = "duration")
    public Integer getDuration() {
        return duration;
    }

    public void setDuration(Integer duration) {
        this.duration = duration;
    }

    @Column(name = "predecessor")
    public String getPredecessor() {
        return predecessor;
    }

    public void setPredecessor(String predecessor) {
        this.predecessor = predecessor;
    }
    @Column(name = "milestone")
    public String getMilestone() {
        return milestone;
    }

    public void setMilestone(String milestone) {
        this.milestone = milestone;
    }
    @Column(name = "scorecardorder")
    public Integer getScorecardOrder() {
        return scorecardOrder;
    }

    public void setScorecardOrder(Integer scorecardOrder) {
        this.scorecardOrder = scorecardOrder;
    }




    @ManyToOne()
    public ScorecardConfiguration getScorecardConfigurationid() {
        return scorecardConfigurationid;
    }

    public void setScorecardConfigurationid(ScorecardConfiguration scorecardConfigurationid) {
        this.scorecardConfigurationid = scorecardConfigurationid;
    }

    @Transient
    public Integer getScid() {
        return scid;
    }

    public void setScid(Integer scid) {
        this.scid = scid;
    }
}